package org.jivesoftware.openfire.plugin;

import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.transport.http.HTTPConstants;
import org.jivesoftware.openfire.util.xsd.PacketIn;

public class Main {
	
	public static void main(String arg[]) {

		  try {
		      WSInterfaceStub sample1ServiceStub = new WSInterfaceStub();
		      sample1ServiceStub
		              ._getServiceClient()
		              .getOptions()
		              .setProperty(Constants.Configuration.TRANSPORT_URL,
		                      "http://localhost:8080/SynchronaService/services/WSInterface");
		      sample1ServiceStub._getServiceClient().getOptions().setProperty(
		              HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
		      
		      AdminInterface adminData = new AdminInterface();
		      OpenfireInterface opi = new OpenfireInterface();
		      PacketIn inData = new PacketIn();
		      
		      inData.setAdminCommand("ws -stop");
		      inData.setBody("sdfsdf");
		      inData.setUserName("sdfsdfsf");
		      adminData.setInDataAdmin(inData);
		      AdminInterfaceResponse response = sample1ServiceStub
		              .adminInterface(adminData);
		      System.out.println(" [ADMIN INFO]" + response.get_return().getExecutionStatus());
		} catch (AxisFault axisFault) {
		      axisFault.printStackTrace();
		} catch (java.rmi.RemoteException e) {
		      e.printStackTrace();
		}

		}

}
